<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>{$title} - {$site_config.site_title}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="{$site_config.seo_keyword}">
    <meta name="description" content="{$site_config.seo_description}">
    <link rel="stylesheet" href="__RES__layui/css/layui.css?v={$site_version}">
    <link rel="stylesheet" href="__RES__css/global.css?v={$site_version}">
</head>
<body>
<div class="header">
    <div class="main">
        <a class="logo" href="{:url('index/index/index')}" title="{$site_config.site_title}">{$site_config.site_title}</a>
        <div class="nav">
            <a class="{$navthis}" href="{:url('index/forum/index')}">
                <i class="iconfont icon-wenda"></i>讨论
            </a>
            <a href="http://www.layui.com/" target="_blank">
                <i class="iconfont icon-ui"></i>框架
            </a>
        </div>
        <div class="nav-user">
            {empty name="$Think.session.userinfo['id']"}
            <!-- 未登入状态 -->
            <a class="unlogin" href="{:url('index/user/login')}"><i class="iconfont icon-touxiang"></i></a>
            <span><a href="{:url('index/user/login')}">登入</a><a href="{:url('index/user/reg')}">注册</a></span>
            <p class="out-login">
                <a href="{:url('index/oauth/index',['type' =>'qq'])}" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})" class="iconfont icon-qq" title="QQ登入"></a>
                <a href="{:url('index/oauth/index',['type' =>'sina'])}" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})" class="iconfont icon-weibo" title="微博登入"></a>
            </p>
            {else /}
            <!-- 登入后的状态 -->
            <a class="avatar" href="{:url('index/user/index')}">
              <img src="{$Think.session.userinfo['headimgurl']}">
              <cite>{$Think.session.userinfo['username']}</cite>
              <i>{$Think.session.userinfo['level']|getLevel}</i>
            </a>
            <div class="nav">
              <a href="{:url('index/user/set')}"><i class="iconfont icon-shezhi"></i>设置</a>
              <a href="{:url('index/user/logout')}"><i class="iconfont icon-tuichu" style="top: 0; font-size: 22px;"></i>退了</a>
            </div>
            {/empty}
        </div>
    </div>
</div>